<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="java.util.*,java.io.*,java.sql.*,java.text.*, dbAccess.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Grant Staff Access</title>
<link rel="stylesheet" type="text/css" href="css_files/style.css" />
</head>
<body>
<%
	Staff staff = new Staff(session.getAttribute("Name").toString());
	DbAccess access = new DbAccess();
	String docId = access.ExecuteScalar(access.connect(), "SELECT DocId FROM tbl_staff WHERE StaffId=" + request.getParameter("staffId") + " AND IsDeleted=0");
	if(!staff.provideStaffPatientAccess(Integer.parseInt(request.getParameter("staffId")), Integer.parseInt(docId)))
	{
		out.print("Access has been granted.");
	}
	else
	{
		out.print("Access hasn't been granted. Maybe access is already granted for this staff member?");
	}	
	
 %>
</body>
</html>